/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.general.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author ctrosch
 */
@Embeddable
public class GR_ConceptoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "GRCCOH_MODCPT", nullable = false, length = 2)
    private String modcpt;
    @Basic(optional = false)
    @Column(name = "GRCCOH_TIPCPT", nullable = false)
    private char tipcpt;
    @Basic(optional = false)
    @Column(name = "GRCCOH_CODCPT", nullable = false, length = 6)
    private String codcpt;

    public GR_ConceptoPK() {
    }

    public String getCodcpt() {
        return codcpt;
    }

    public void setCodcpt(String codcpt) {
        this.codcpt = codcpt;
    }

    public String getModcpt() {
        return modcpt;
    }

    public void setModcpt(String modcpt) {
        this.modcpt = modcpt;
    }

    public char getTipcpt() {
        return tipcpt;
    }

    public void setTipcpt(char tipcpt) {
        this.tipcpt = tipcpt;
    }
    
    public GR_ConceptoPK(String grccohModcpt, char grccohTipcpt, String grccohCodcpt) {
        this.modcpt = grccohModcpt;
        this.tipcpt = grccohTipcpt;
        this.codcpt = grccohCodcpt;
    }
  
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (modcpt != null ? modcpt.hashCode() : 0);
        hash += (int) tipcpt;
        hash += (codcpt != null ? codcpt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GR_ConceptoPK)) {
            return false;
        }
        GR_ConceptoPK other = (GR_ConceptoPK) object;
        if ((this.modcpt == null && other.modcpt != null) || (this.modcpt != null && !this.modcpt.equals(other.modcpt))) {
            return false;
        }
        if (this.tipcpt != other.tipcpt) {
            return false;
        }
        if ((this.codcpt == null && other.codcpt != null) || (this.codcpt != null && !this.codcpt.equals(other.codcpt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.global.modelo.ConceptoPK[grccohModcpt=" + modcpt + ", grccohTipcpt=" + tipcpt + ", grccohCodcpt=" + codcpt + "]";
    }

}
